import { defineStore } from 'pinia'

export const useCounterStore = defineStore('counter', {
  state: () => {
    return {
      count: 1
    }
  },
  persist: { //  固化插件
    enabled: true, // 开启存储
  },
  getters:{},
  actions:{
    increment(){
      this.count++;
    },
    doubleCount(){
      this.count = this.count * 2;
    }
  }
})
